import {
  HTTP
}
from '../utils/http.js';

import {
  config
}
from '../config/config.js';

class GoodsModel extends HTTP {
  getGoodsCount() {
    return this.request({
      url: config.GoodsCount
    })
  }

  getGoodsList(p_id, p_page, p_size) {
    return this.request({
      url: config.GoodsList,
      data: {
        categoryId: p_id,
        page: p_page,
        size: p_size
      }
    })
  }

  getGoodsCategory(p_id) {
    return this.request({
      url: config.GoodsCategory,
      data: {
        id: p_id
      }
    })
  }

  getGoodsNew() {
    return this.request({
      url: config.GoodsNew
    })
  }

  getGoodsHot() {
    return this.request({
      url: config.GoodsHot
    })
  }
}

export {
  GoodsModel
}